#cs ----------------------------------------------------------------------------

 AutoIt Version: 3.3.10.2
 Author:         myName

 Script Function:
	Template AutoIt script.

#ce ----------------------------------------------------------------------------

; Script Start - Add your code below here

$delay = 150

$counter = 0

$HeroSlots = 10

$i = 0

HotKeySet("^{ENTER}", "end")

_WinWaitActivate("BlueStacks App Player", "")

While($counter < 14)
_WinWaitActivate("BlueStacks App Player", "")

MouseClick("left",1050,760,1) ;hire with shards
Sleep($delay)

$i = 0

If ($HeroSlots > 0) Then
	for $i = 0 To ($HeroSlots - 1) Step 1
		MouseClick("left",1055,487,1) ;gel champion
		Sleep($delay)

		MouseClick("left",721,576,1) ;confirmation
		Sleep($delay)
	Next

#cs
MouseClick("left",1049,417,1)
Sleep($delay)
MouseClick("left",724,570,1)
Sleep($delay)
MouseClick("left",1065,414,1)
Sleep($delay)
MouseClick("left",715,574,1)
Sleep($delay)
#ce

MouseClick("left",231,85,1)  ;back
Sleep($delay)

;--------- Hero Stuff ------------------------------
;Translate8()
;Translate8()

;Sleep(100000)

MouseClick("left",325,299,1) ;Hero Slot
Sleep($delay)
;---------------------------------------------------

If ($HeroSlots <= 5) Then
	MouseClick("left",911,453,1)  ;consume button
	Sleep($delay)
	MouseClick("left",782,511,1)  ;auto add
	Sleep($delay)
	MouseClick("left",1078,513,1) ;consume
	Sleep($delay)
	MouseClick("left",721,580,1)   ;confirmation
	Sleep($delay)

Else
	for $i = 0 To Ceiling($HeroSlots / 5) Step 1

		MouseClick("left",911,453,1)  ;consume button
		Sleep($delay)
		MouseClick("left",782,511,1)  ;auto add
		Sleep($delay)
		MouseClick("left",1078,513,1) ;consume
		Sleep($delay)
		MouseClick("left",721,580,1)   ;confirmation
		Sleep($delay)

	Next

EndIf


MouseClick("left",243,90,1)   ;back
Sleep($delay)
MouseClick("left",243,90,1)   ;back

$counter += 1

EndIf
WEnd

Func end()
	Exit
EndFunc   ;==>end

Func _WinWaitActivate($title, $text, $timeout = 0)
	$ApplicationHandle = WinWait($title, $text, $timeout)
	If Not WinActive($title, $text) Then WinActivate($title, $text)
	WinWaitActive($title, $text, $timeout)
EndFunc   ;==>_WinWaitActivate

;1096 406 to 197, 406
Func Translate8()

	MouseMove(1096, 404)
	MouseDown("left")
	MouseMove(225, 404, 10)
	Sleep(1000)
	MouseUp("left")

EndFunc